import request from '@/utils/request.js'

// 轮播图
export const banner = () => request('/banner?type=2')

// 推荐歌单
export const personalized = (limit = 10) => request(`/personalized?limit=${limit}`)

// 歌单详情
export const playlistDetail = ({ id = '', s = 8 }) => request(`/playlist/detail?id=${id}&s=${s}`)

// 获取歌单内所有歌曲
export const allPlaylist = (params = { id: '', limit: 30, offset: 0 }) =>
  request(`/playlist/track/all?id=${params.id}&limit=${params.limit}&offset=${params.offset}`)

// 歌单列表
export const playLists = ({ order = 'hot', cat = '', limit = 50, offset = 0 }) =>
  request(`/top/playlist?limit=${limit}&order=${order}&cat=${cat}&offset=${offset}`)

// 热门歌单分类
export const hotList = () => request('/playlist/hot')

// 新碟上架
export const topAlbum = ({ limit = 20, offset = 0, area = 'all', type = 'new', year = '', month = '' }) =>
  request(`/top/album?limit=${limit}&offset=${offset}&area=${area}&type=${type}&year=${year}&month=${month}`)

// 歌词
export const lyrics = (id) => request(`/lyric?id=${id}`)

// 获取MV
export const mvlist = ({ area = '', type = '', order = '', limit = 50, offset = 0 }) => request(`/mv/all?area=${area}&type=${type}&order=${order}&limit=${limit}&offset=${offset}`)

// 最新专辑
export const newestAlbum = () => request('/album/newest')

// 热门歌单分类
export const hotCatlist = () => request('/playlist/hot')

// 歌单列表
export const playList = ({ order = 'hot', cat = '', limit = 50, offset = 0 }) => request(`/top/playlist?limit=${limit}&order=${order}&cat=${cat}&offset=${offset}`)

// 歌曲评论
export const songComment = (id) => request(`/comment/music?id=${id}`)

// 最新 MV
export const firstMv = ({ limit = 10 }) => request(`/mv/first?limit=${limit}`)

// 热门歌手
export const hotSinger = ({ offset = 0, limit = 10 }) => request(`/top/artists?offset=${offset}&limit=${limit}`)

// 歌曲详情
export const songDetail = (ids = '') => request(`/song/detail?ids=${ids}`)